package com.exrobot.module.rbt.dal.mysql.orderitem;

import java.util.*;

import com.exrobot.framework.common.pojo.PageResult;
import com.exrobot.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.exrobot.framework.mybatis.core.mapper.BaseMapperX;
import com.exrobot.module.rbt.dal.dataobject.orderitem.OrderItemDO;
import org.apache.ibatis.annotations.Mapper;
import com.exrobot.module.rbt.controller.admin.orderitem.vo.*;

/**
 * 订单信息 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface OrderItemMapper extends BaseMapperX<OrderItemDO> {

    default PageResult<OrderItemDO> selectPage(OrderItemPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<OrderItemDO>()
                .eqIfPresent(OrderItemDO::getOrderSn, reqVO.getOrderSn())
                .inIfPresent(OrderItemDO::getOrderSn, reqVO.getOrderSns())
                .eqIfPresent(OrderItemDO::getRobotSn, reqVO.getRobotSn())
                .inIfPresent(OrderItemDO::getRobotSn, reqVO.getRobotSns())
                .eqIfPresent(OrderItemDO::getTaskNo, reqVO.getTaskNo())
                .eqIfPresent(OrderItemDO::getMenuSn, reqVO.getMenuSn())
                .eqIfPresent(OrderItemDO::getStatus, reqVO.getStatus())
                .inIfPresent(OrderItemDO::getStatus, reqVO.getStatusList())
                .betweenIfPresent(OrderItemDO::getCreateTime,reqVO.getCreateTime())
                .orderByDesc(OrderItemDO::getId));
    }

}